package com.unswift.window.table;

public class CellValidate {
	
	public static CellValidate create(boolean isNull){
		return new CellValidate(isNull, false);
	}
	public static CellValidate create(boolean isNull, boolean isNumber){
		return new CellValidate(isNull, isNumber);
	}
	public static CellValidate create(boolean isNull, boolean isNumber, String regexp, String regexpMessage){
		return new CellValidate(isNull, isNumber, regexp, regexpMessage);
	}
	public static CellValidate create(boolean isPk, Object pkValue){
		return new CellValidate(false, isPk, pkValue);
	}
	private boolean isNull;
	private boolean isPk=false;
	private Object pkValue;
	private boolean isNumber;
	private String regexp;
	private String regexpMessage;
	public CellValidate(boolean isNull, boolean isNumber) {
		this.isNull=isNull;
		this.isNumber=isNumber;
	}
	public CellValidate(boolean isNull, boolean isPk, Object pkValue) {
		this.isNull=isNull;
		this.isPk=isPk;
		this.pkValue=pkValue;
	}
	public CellValidate(boolean isNull, boolean isNumber, String regexp, String regexpMessage) {
		this.isNull=isNull;
		this.isNumber=isNumber;
		this.regexp=regexp;
		this.regexpMessage=regexpMessage;
	}
	public boolean isNull() {
		return isNull;
	}

	public void setNull(boolean isNull) {
		this.isNull = isNull;
	}
	public boolean isPk() {
		return isPk;
	}
	public void setPk(boolean isPk) {
		this.isPk = isPk;
	}
	public Object getPkValue() {
		return pkValue;
	}
	public void setPkValue(Object pkValue) {
		this.pkValue = pkValue;
	}
	public boolean isNumber() {
		return isNumber;
	}
	public void setNumber(boolean isNumber) {
		this.isNumber = isNumber;
	}
	public String getRegexp() {
		return regexp;
	}
	public void setRegexp(String regexp) {
		this.regexp = regexp;
	}
	public String getRegexpMessage() {
		return regexpMessage;
	}
	public void setRegexpMessage(String regexpMessage) {
		this.regexpMessage = regexpMessage;
	}
	
}
